package com.adb.androidwebalbum;

import android.app.Application;

import com.adb.androidwebalbum.utils.AssetsImageDownloader;
import com.nostra13.universalimageloader.cache.disc.naming.Md5FileNameGenerator;
import com.nostra13.universalimageloader.core.ImageLoader;
import com.nostra13.universalimageloader.core.ImageLoaderConfiguration;

public class PhotoGalleryApplication extends Application {
	

	public PhotoGalleryApplication() {
	}
	
	@Override
	public void onCreate() {
		super.onCreate();
		ImageLoaderConfiguration mConfig = new ImageLoaderConfiguration.Builder(getApplicationContext())
		.threadPoolSize(3)
		.threadPriority(Thread.NORM_PRIORITY - 2)
		.memoryCacheSize(2 * 1024 * 1024) // 2 Mb
		.denyCacheImageMultipleSizesInMemory()
		.discCacheFileNameGenerator(new Md5FileNameGenerator())
		.imageDownloader(new AssetsImageDownloader(getApplicationContext()))
		.enableLogging() // Not necessary in common
		.build();
			
		// Initialize ImageLoader with configuration.
		ImageLoader.getInstance().init(mConfig);
	}
	
	
	
}
